home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2008 April
/
PCWorld_2008-04_cd.bin
/
komercni software
/
miton
/
SystemMechanic7Pro.exe
/
{app}
/
smhtml.dll
/
1033
/
HTML
/
INTELLIINTERNETSPEEDBAR.JS
< prev
next >
Wrap
Text File
|
2008-01-24
|
5KB
|
132 lines
function IntelliInternetSpeedBarProperties()
{
this.FullBarWidth = 0;
this.HilighterLeft = 0;
this.HilighterWidth = 50;
this.HilighterBackgroundImage = "ITS_speed_highlighter.gif";
this.HolderWidth = "48px";
this.HolderMarginLeft = "1px";
this.LowRange = "0";
this.HighRange = "128k";
this.Get = __GetIntelliInternetSpeedBarProperties;
function __GetIntelliInternetSpeedBarProperties(Range)
{
this.HilighterBackgroundImage = "ITS_speed_highlighter.gif";
this.HolderWidth = "48px";
this.HolderMarginLeft = "1px";
switch(Range)
{
case "0":case 0:
this.FullBarWidth = 0;
this.HilighterLeft = 0;
this.HilighterBackgroundImage = "ITS_speed_highlighter_left.gif";
this.HilighterWidth = 60;
this.HolderWidth = "50px";
this.HolderMarginLeft = "10px";
this.LowRange = "0";
this.HighRange = "128k";
break;
case "1" : case 1:
this.FullBarWidth = 50;
this.HilighterLeft = 61;
this.LowRange = "128k";
this.HighRange = "384k";
break;
case "2" : case 2:
this.FullBarWidth = 100;
this.HilighterLeft = 110;
this.LowRange = "384k";
this.HighRange = "768k";
break;
case "3" : case 3:
this.FullBarWidth = 150;
this.HilighterLeft = 159;
this.LowRange = "768k";
this.HighRange = "1.5M";
break;
case "4" : case 4:
this.FullBarWidth = 200;
this.HilighterLeft = 208;
this.LowRange = "1.5M";
this.HighRange = "3M";
break;
case "5" : case 5:
this.FullBarWidth = 250;
this.HilighterLeft = 256;
this.HilighterBackgroundImage = "ITS_speed_highlighter_right.gif";
this.HilighterWidth = 57;
this.LowRange = "3M";
this.HighRange = "6M+";
break;
}
}
}
function IntelliInternetSpeedBar(id)
{
this.ID = id || "";
this.Progress = 100;
this.Render = __IntelliInternetSpeedBarRender;
this.IsRendered = __IntelliInternetSpeedBarIsRendered;
this.SetRange = __IntelliInternetSpeedBarRange;
this.SetProgress = __IntelliInternetSpeedBarProgress;
function __IntelliInternetSpeedBarIsRendered()
{
return Get( "div_emptybar_" + this.ID ) == null ? false : true;
}
function __IntelliInternetSpeedBarRender()
{
var html = "";
html += "<div id=\"div_emptybar_" + this.ID + "\" style=\"background:url(ITS_speed_overallbar_empty.gif) no-repeat left top; position:absolute; left:10px; top:8px; z-index:1; width:296px; height:10px\"></div> ";
html += "<div id=\"div_fullbar_" + this.ID + "\" style=\"background:url(ITS_speed_overallbar_full.gif) no-repeat left top; position:absolute; left:11px; top:8px; z-index:2; width:50px; height:10px\">";
html += "</div>";
html += "<div id=\"div_highlighter_" + this.ID + "\" style=\"background:url(ITS_speed_highlighter.gif) no-repeat left top; position:absolute; left:61px; top:0px; z-index:3; width:50px; height:22px\">";
html += "<div id=\"div_holder_" + this.ID + "\" style=\"width:48px; height:10px; margin-top:8px; margin-left:1px\">";
html += "<div id=\"div_progress_" + this.ID + "\" style=\"float:left;height:8px; width: " + this.Progress + "%; background:url(ITS_speed_overallbar_full_highlighted.gif) right top repeat-x;\"></div>";
//html += "<div style=\"float:right; background:inherit; height:8px; width:57%;\"></div>";
html += "</div>";
html += "</div>";
return html;
}
function __IntelliInternetSpeedBarRange(Range)
{
var p = null;
if( typeof(Range) == 'object' )
p = Range;
else
{
p = new IntelliInternetSpeedBarProperties();
p.Get(Range);
}
Get("div_fullbar_" + this.ID ).style.width = p.FullBarWidth;
var divHighLighter = Get("div_highlighter_" + this.ID );
divHighLighter.style.left = p.HilighterLeft;
divHighLighter.style.width = p.HilighterWidth;
divHighLighter.style.backgroundImage = "url('" + p.HilighterBackgroundImage + "')";
var divHolder = Get("div_holder_" + this.ID );
divHolder.style.width = p.HolderWidth;
divHolder.style.marginLeft = p.HolderMarginLeft;
}
function __IntelliInternetSpeedBarProgress(Progress)
{
Get("div_progress_" + this.ID ).style.width = Progress + "%";
}
}